package cn.zn.modules.pz.cur.service.impl;

import cn.zn.modules.pz.cur.dao.TpbTripTrafficMapper;
import cn.zn.modules.pz.cur.entity.TpbTripTraffic;
import cn.zn.modules.pz.cur.service.TpbTripTrafficService;
import cn.zn.modules.pz.his.entity.vo.PzTripVO;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.stream.Collectors;

@Service
public class TpbTripTrafficServiceImpl extends ServiceImpl<TpbTripTrafficMapper, TpbTripTraffic> implements TpbTripTrafficService {

    @Override
    public List<PzTripVO> findByMainId(String mainId) {
        return this.baseMapper.findByMainId(mainId).stream().map(o -> {
            PzTripVO pzTripVO = new PzTripVO();
            BeanUtils.copyProperties(o, pzTripVO);
            return pzTripVO;
        }).collect(Collectors.toList());
    }
}
